package reflect;

import java.io.FileInputStream;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class ReflectDemo1 {
    public static void main(String[] args) throws ClassNotFoundException {
        String s;
        Class c= StringBuffer.class;
        String string = c.getName();
        System.out.println(string);

        Package p=c.getPackage();
        System.out.println(p.getName());

        System.out.println("input:");
        Scanner scanner = new Scanner(System.in);
        String className = scanner.nextLine();
        Class c2=Class.forName(className);

        Method[] methods=c2.getMethods();
        System.out.println(methods.length);
        for(Method e : methods)
        {
            System.out.println(e.getName());
        }
//
//        Class c2=Class.forName("java.lang.String");
//        Class c3=Class.forName("java.util.ArrayList");
//        Class c4=Class.forName("java.io.FileInputStream");

    }
}
